package com.vdong.trade.trading.respository;

import com.vdong.trade.trading.entity.dto.param.ChannelEarningCurveParamDTO;
import com.vdong.trade.trading.entity.dto.result.MerchantSettlementAllResultDTO;
import com.vdong.trade.trading.entity.po.FinanceParamDTO;
import com.vdong.trade.trading.entity.po.SettlementTotalParamDTO;
import com.vdong.trade.trading.entity.mo.*;
import org.apache.ibatis.annotations.Mapper;


import java.util.List;
import java.util.Optional;

@Mapper
public interface TradingMOMapper {

    /**
     * 将数据插入到数据库
     *
     * @param trading
     * @return 返回成功新增的个数
     */
    int insertTrading(TradingMO trading);

    /**
     * 根据ID删除数据
     *
     * @param id
     * @return 返回成功删除记录的个数
     */
    //int deleteTradingById(Long id);

    /**
     * 根据ID修改数据
     *
     * @param id
     * @return 返回成功修改记录的个数
     */
    int updateTradingById(TradingMO trading);

    /**
     * 根据ID查询数据
     *
     * @param id
     * @return 返回成功查询记录
     */
    TradingMO selectTradingById(Long id);


    TradingMO selectTradingByParam(TradingMO trading);

    /**
     * 根据条件查询数据
     *
     * @param trading
     * @return 返回查询的记录列表
     */
    List<TradingMO> selectTradingListByCond(TradingMO trading);

    /**
     * 根据条件查询数据的条数
     *
     * @param trading
     * @return 返回查询的记录条数
     */
    Integer selectTradingCntByCond(TradingMO trading);

    List<MerchantTotalListResultMO> settlementMerchantTotalList(SettlementTotalParamDTO param);

    List<MerchantRecordResultMO> settlementMerchantRecord(SettlementTotalParamDTO param);

    List<MerchantDetailMO> settlementMerchantDetail(SettlementTotalParamDTO param);

    EarningMO selectEarnings(FinanceParamDTO param);

    List<ChannelEarningCurveMO> channelEarningCurve(ChannelEarningCurveParamDTO param);

    MerchantSettlementAllMO settlementAll(SettlementTotalParamDTO param);

    SettlementAllEarningsMO settlementAllEarnings(SettlementTotalParamDTO param);

    MerchantSettlementAllMO settlementDetailEarnings(SettlementTotalParamDTO param);

    List<TradingMO> selectTradingListByParam(TradingMO build);

    PusherEarningMO pusherEarnings(FinanceParamDTO paramDTO);

    PusherSettlementAndCountMO pusherSettlementAndCount(SettlementTotalParamDTO param);
}